home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 3457 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.4 KB

  1. Path: news.epix.net!usenet
  2. From: hphilips@epix.net (Harry Philips)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: help with pi algorithm
  5. Date: 29 Jan 1996 03:42:03 GMT
  6. Organization: epix.net
  7. Message-ID: <4ehfmb$1kn@guava.epix.net>
  8. References: <0fc_9601240111@csource.blaze.net.au>
  9. NNTP-Posting-Host: cpbgppp67.epix.net
  10. X-Newsreader: WinVN 0.92.2
  11.  
  12. In article <0fc_9601240111@csource.blaze.net.au>, Andrew.Nesbit@f396.n634.z3.fidonet.org (Andrew Nesbit) says:
  13.  
  14. >
  15. >I am a newbie C programmer trying to write an algorithm to work out the
  16. >value of pi fairly accurately. 
  17.  
  18. >Any comments please???
  19. >
  20. >Also, are there any 'standard' algorithm books which would demonstrate this
  21. >sort of programming technique?
  22.  
  23. The other respondants to your query I've seen do not pick up on your 
  24. accuracy requirement. Another suggestion: get a copy of SNIPPETS, an
  25. archive of C functions in C source code form. The file is big and contains
  26. more than 300 functions, mostly in C but a few are in assembler and one
  27. is in AWK. One place to look is the ftp site at oak.oakland.edu. The MSDOS
  28. directory in /SimTel has a /C subdirectory if I remember correctly. The
  29. file name should be something likd SNIP95mm.ZIP where mm is the month of
  30. release. My copy which is one release backlevel is almost 400K. 
  31.  
  32. Back to your question. The PI function included calculates the value of PI
  33. to some 60,000 decimal places and you can dig the algorithm used out of the
  34. source code with a bit of excruciating effort.
  35.  
  36. Cheers,
  37.  
  38. Harry
  39.  
  40.